IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CSLive_Settings]') AND type in (N'U'))
DROP TABLE [dbo].[CSLive_Settings]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[CSLive_Settings](
	[SettingsXML] [ntext] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CSLive_Settings_Get]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[CSLive_Settings_Get]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER OFF
GO

CREATE PROCEDURE [dbo].[CSLive_Settings_Get]
AS
SELECT 
	SettingsXML
FROM [CSLive_Settings] 
		
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CSLive_Settings_Update]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[CSLive_Settings_Update]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER OFF
GO

CREATE PROCEDURE [dbo].[CSLive_Settings_Update]
(
	@SettingsXML ntext = null
)
AS

DELETE [CSLive_Settings]
INSERT INTO [CSLive_Settings] VALUES (@SettingsXML)
		
GO